package cn.jhz.learn.blog.dao.article;

import cn.jhz.learn.blog.po.article.BlogArticleSubfield;
import cn.jhz.learn.blog.vo.article.query.count.SubfieldCount;
import cn.jhz.learn.blog.vo.article.query.view.SubfieldView;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface BlogArticleSubfieldMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(BlogArticleSubfield record);

    int insertSelective(BlogArticleSubfield record);

    BlogArticleSubfield selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(BlogArticleSubfield record);

    int updateByPrimaryKey(BlogArticleSubfield record);

    /*自定义*/
    SubfieldCount countByBlogId(@Param("blog_id") Integer id);

    List<SubfieldView> selectByBlogId(@Param("blog_id") Integer blogId,
                                      @Param("visibility")List<Byte> visibility,
                                      @Param("status")List<Byte> status);

    Map<String, Object> countAccessAndSubscribeByPrimaryKey(@Param("id") Integer id,@Param("status") List<Byte> status);

//    List<SubfieldView> selectHotByBlogId(@Param("blog_id") Integer blogId,
//                                   @Param("visibility")List<Byte> visibility,
//                                   @Param("status")List<Byte> status);
//
//    List<SubfieldView> selectLatestByBlogId(@Param("blog_id") Integer blogId,
//                                      @Param("visibility")List<Byte> visibility,
//                                      @Param("status")List<Byte> status);
//
//    List<SubfieldView> selectAccessByBlogId(@Param("blog_id") Integer blogId,
//                                      @Param("visibility")List<Byte> visibility,
//                                      @Param("status")List<Byte> status);
}